#pragma once

#include "Material.h"
#include "libmesh/meshfree_interpolation.h"
using std::string;
using std::vector;

class Function;

class ConvectionHeatFluxMaterial : public Material
{
public:
	ConvectionHeatFluxMaterial(const InputParameters & parameters);

protected:
	virtual void computeProperties();

private:
	void readFile();
	void interpolate(std::vector<Real> &qc, std::vector<Real>  &ts,std::vector<Real>  &tw0, std::vector<Point> &pts, Real t);
	void check();
	MaterialProperty<Real> & _convection_flux;
	MaterialProperty<Real>& _convection_flux_jacobi;
	MaterialProperty<Real> & _convection_flux_hotwall;
	MaterialProperty<Real> & _convection_flux_hotwall_jacobi;
	MaterialProperty<Real>& _convection_flux_coldwall;
	MaterialProperty<Real> & _tw0;

	const VariableValue & _temperature;
	const MaterialProperty<Real> & _epsilon;

	string _data_file;
	string _flux_file;
	vector<vector<Real> > _src_qc;
	vector<vector<Real> > _src_ts;
	vector<vector<Real> > _src_tw0;
	vector<vector<Point> >_src_pts;
	vector<Real> _time_step;
	vector<string> _field_name;

	vector<InverseDistanceInterpolation<LIBMESH_DIM> *  > _idis;
	int _num_pts;
	int _num_time_step;
	std::vector<Real> _scale;
	Real _fluxcoff;
};

template<>
InputParameters validParams<ConvectionHeatFluxMaterial>();
